<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>

	<script>
		const a = 2
		const b = 3
		const c = 4
		const promise = new Promise((reslove, reject) => {
			if (a == 2) {
				reslove(a)
			} else {
				reject(Error)
			}
		})

		promise.then(res => {
			return new Promise((reslove, reject) => {
				if (b == 3) {
					reslove(b)
				} else {
					reject()
				}
			})
		}).then(res => {
			return new Promise((reslove, reject) => {
				if (c == 4) {
					reslove(c)
				} else {
					reject()
				}
			})
		})
	</script>

	<script>
	</script>

</body>

</html>